package com.zhoug.android.common.ui;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

/**
 * @Author: zhoug
 * @Date: 2022/9/1
 * @Description:
 */
public abstract class BaseActivity extends AppCompatActivity implements IActivity, IEventBusSubscriber {
    private static final String TAG = ">>>BaseActivity";
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initOrientation();
        beforeLayout(savedInstanceState);
        setContentView(getLayoutResID());
        initStatusBar();

    }

    @Override
    public boolean openEventBus() {
        return false;
    }

    @Override
    public void registerEventBus() {

    }

    @Override
    public void unregisterEventBus() {

    }


    @Override
    protected void onDestroy() {
        if(openEventBus()){
            unregisterEventBus();
        }
        super.onDestroy();
    }

}
